<?
include 'includes/specs_functions.php';
echo printGoogleAnalytics();

$output = "
	<script>
		function import_specs(){
			var params = {	email: $('#email').val()
							,password: $('#password').val() 
						};
			$('#search-results').html('<div class=\"center\"><div class=\"center loader-gif\" style=\"top:262px;position: relative;\"></div></div>');
			$('#search-results').fadeIn('fast');
			$.post('specs/php/import_query.php?".time()."', addSessionVars(params), function(data) {
					if (data.status == 'success') {
						$('#search-results').html('<div class=\"normal-text\" style=\"margin-left: 25px;margin-top: 20px;\">'+data.message+'</div>');
						$('#search-results').fadeIn('fast');
					}else{
						var msg = 'Sorry but there was an error';
						$('#search-results').html(msg + xhr.status + ' ' + xhr.statusText);
					}
				}, 'json');
		}
		
	</script>
	<div id='indent-content-container' class='me-content-container'>
		<div id='mask-content-container' class='fl-left'>
			<div class = 'content-subtitle-container-left fl-left' style='height: 125px;'></div>
			<div class='fl-right'>
				<div id='search-mask' class='fl-left' style='width: 713px;'>
				<!-- FILTER -->
					<form method='POST' action='javascript:import_specs();'>
						<div class='fl-left' style='height: 64px; padding-top: 15px; padding-left: 10px;'>	
							<table>
								<tr>
									<td class='td-table vertical-middle' style='padding-bottom: 20px;' colspan='3'>
										<div class='normal-text bold-text blue-text pad-l-50'>Import your specs from ffxivspecs.com! Enter your email and password from ffxivspecs and import your specs!</div>
									</td>
								</tr>
								<tr>
									<td class='td-table vertical-middle' style='width: 90px;'>
										<div class='normal-text bold-text pad-l-50'>Email:</div>
									</td>
									<td colspan='2'>
										<input id='email' type='text' style='width:200px'>
									</td>
								</tr>
								<tr>
									<td class='td-table vertical-middle' style='width: 90px;'>
										<div class='normal-text bold-text pad-l-50'>Password:</div>
									</td>
									<td >
										<input id='password' type='password' style='width:200px'>
									</td>
									<td style='text-align: right;width: 390px;'>
										<div >
											<input id='reset-button' type='reset' value='Reset' style='cursor:pointer;'/>
											<input id='search-button' type='submit' value='Import' style='cursor:pointer;'/>
											
										</div>
									</td>
								</tr>
							</table>
						</div>
						<div style='clear:both;'></div>
					</form>
				</div>	
				<div class = 'content-subtitle-container-right fl-right' style='height: 125px;'></div>
			</div>
		</div>
		<div style='clear:both; height:5px;'></div>
		<div class='content-subtitle-container-open'></div>
			<div id='search-results-out'>
				<div id='search-results' style='min-height: 549px;'>

				</div>
			</div>
		<div class='content-subtitle-container-close'></div>
	</div>
";
		
echo $output;
?>


		
